<template>
  <Form
    :label-width="120"
    ref="formValidate"
    :model="formValidate"
    label-position="left"
  >
    <FormItem prop="title" label="消息标题">
      {{formValidate.title}}
    </FormItem>
    <FormItem prop="text" label="消息内容">
      {{formValidate.text}}
    </FormItem>
    <FormItem label="消息类型">
    {{formValidate.msgType}}
    </FormItem>
    <FormItem label="状态" >
      {{formValidate.msgStatus}}
    </FormItem>
    <FormItem label="时间">
      {{formValidate.gmtCreate}}
    </FormItem>
    <FormItem label="发送人">
      {{formValidate.sender}}
    </FormItem>
    <FormItem>
      <Button v-if="type==1"
        type="primary"
        @click="publicSubmit('formValidate')"
      >确定
      </Button>
      <Button @click="publicReset('formValidate')" style="margin-left: 8px">取消</Button>
    </FormItem>
  </Form>
</template>

<script>
import { updateMixin } from '../../mixin'
import { updateMsgStatus } from '../../api/modules/person/msgTask'
import message from '../../utils/message'
import API_KEY from '../../api'

export default {
  name: 'MsgTaskView',
  mixins: [updateMixin],
  data () {
    return {
      formValidate: {
        title: '',
        sender: '',
        text: '',
        msgType: '',
        msgStatus: 0,
        gmtCreate: ''
      },
      updateForm: {
        id: '',
        msgStatus: '',
        processingContent: ''
      },
      action: {
        readDataById: API_KEY.msgTask.def
      }

    }
  },
  mounted () {
  },
  methods: {
    updateMsgStatus () {
      this.updateForm.id = this.moduleId
      updateMsgStatus(this.updateForm).then(res => {
        message.message.success(res.message)
      })
    }
  }
}
</script>

<style scoped>

</style>
